package com.cqq.auth.dao.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.cqq.auth.dao.PermissionDao;
import com.cqq.auth.dao.domain.Permission;
import com.cqq.auth.dao.mapper.PermissionMapper;
import com.cqq.common.core.base.BaseDao;
import com.cqq.common.core.base.BaseQuery;

/**
 * <h3>权限Dao接口实现类</h3>
 * 
 * @author xijq
 * @version 1.0.0
 * 
 */
@Repository("permissionDao")
public class PermissionDaoImpl extends BaseDao implements PermissionDao {
	
	@Autowired
	private PermissionMapper permissionMapper;

	
	public void add(Permission obj) {
		permissionMapper.add(obj);
	}

	
	public Integer delete(Serializable id) {
		return permissionMapper.delete(id);
	}

	
	public Integer update(Permission obj) {
		return permissionMapper.update(obj);
	}

	
	public Permission queryById(Serializable id) {
		return permissionMapper.queryById(id);
	}

	
	public List<Permission> queryAll() {
		return permissionMapper.queryAll();
	}

	
	public List<Permission> queryPage(BaseQuery query) {
		return permissionMapper.queryPage(query);
	}

	
	public Integer queryCount(BaseQuery query) {
		return permissionMapper.queryCount(query);
	}

	
	public List<Permission> queryByUserId(Integer id, String systemCode) {
		return permissionMapper.queryByUserId(id, systemCode);
	}

	
	public List<Permission> queryByUsername(String username, String systemCode) {
		return permissionMapper.queryByUsername(username, systemCode);
	}

	
	public Permission queryByCode(String roleCode, String systemCode) {
		return permissionMapper.queryByCode(roleCode, systemCode);
	}

	
	public Permission queryByName(String name, String systemCode) {
		return permissionMapper.queryByName(name, systemCode);
	}

	
	public List<Permission> queryByRoleId(Integer id) {
		return permissionMapper.queryByRoleId(id);
	}
	
	
	public List<Permission> queryAllBySystem(String systemCode) {
		return permissionMapper.queryAllBySystem(systemCode);
	}

	
	public List<Integer> queryIdsBySystem(String systemCode) {
		return permissionMapper.queryIdsBySystem(systemCode);
	}

	
	public List<Permission> queryByParentId(Integer id,String systemCode) {
		return permissionMapper.queryByParentId(id,systemCode);
	}
	
}
